-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: show testcontainers using oci image as fixture #222
Conversation
import sys | ||
import pytest | ||
|
||
if __name__ == "__main__": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note, this is what the aspect_rules_py py_pytest_main
creates. That repo isn't on registry.bazel.build yet, so I just vendored the file content here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# https://github.com/testcontainers/testcontainers-python/blob/2bcb931063e84da1364aa26937778f0e45708000/core/testcontainers/core/container.py#L107-L108 | ||
port = container.get_exposed_port(8080) | ||
|
||
# TODO(alexeagle): have the application inside the container listen on a port so we can use it as a test fixture |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thesayyn I'm not sure it's worth landing this until we can actually communicate with a python process running in the container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could make it a separate example here? and use testcontainers instead of structure_test for testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could imagine a separate "integration testing" example that wants to tie together the other stuff in this repo - we'd have our first cross-workspace dependencies though.
I'm getting close to writing a blog post about it, is why I'm working in here at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right place for this. This is python using Docker, nothing to do with rules_oci.
@f0rmiga This is what clients asked for. If they build an image in their monorepo, how do they use it in an integration test fixture? They want to see them together. |
I understand this is desirable, but in the same way that you removed Gazelle from this example, I don't think we should do integration. I can see this being an example on its own. |
I can be convinced of the contrary... |
No I agree as each example gains features it gets harder to navigate and understand each bit in isolation |
I'll put this in #223 instead, it's going to be a big one |
I had a request from a client today to see an example like this. I suspect it will be widely useful to see an e2e test that can coordinate our java, python, and java OCI containers we build in this repo.
Type of change
Test plan
bazel test ...